Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support create pipeline to intrgrate scanner to cicd #2574

Merged
merged 8 commits into from
Aug 30, 2024
Merged

Conversation

winfredLIN
Copy link
Collaborator

@winfredLIN winfredLIN commented Aug 30, 2024

关联的 issue

#2564

描述你的变更

确认项(pr提交后操作)

Tip

请在指定复审人之前,确认并完成以下事项,完成后✅


  • 我已完成自测
  • 我已在关联的issue里补充了实现方案
  • 我已在关联的issue里补充了测试影响面
  • 我已确认了变更的兼容性,如果不兼容则在issue里标记 not_compatible
  • 我已确认了是否要更新文档,如果要更新则在issue里标记 need_update_doc

@winfredLIN winfredLIN requested a review from sjjian August 30, 2024 08:51
@winfredLIN winfredLIN changed the title feat: pipeline feat: support create pipeline to intrgrate scanner to cicd Aug 30, 2024
@sjjian sjjian merged commit 214bea3 into main Aug 30, 2024
3 checks passed
@sjjian sjjian deleted the issue-2564-1 branch August 30, 2024 10:27
switch model.PipelineNodeType(node.NodeType) {
case model.NodeTypeAudit:
var cmdUsage = "#使用方法#\n1. 确保运行该命令的用户具有scannerd的执行权限。\n2. 在scannerd文件所在目录执行启动命令。\n#启动命令#\n"
baseCmd := "./scannerd %s --host=\"%s\" --port=\"%s\" --dir=\"%s\" --token=\"%s\""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

智能扫描也有类似的展示command的功能,是不是可以放一起

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get,这一点后续看一下怎么合在一起

func (svc PipelineSvc) newToken(userId, version, uuid string) (string, error) {
token, err := dmsCommonJwt.GenJwtToken(
dmsCommonJwt.WithUserId(userId),
dmsCommonJwt.WithExpiredTime(365*24*time.Hour),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

期望有过期时间吗,一年后咋办

Name string `gorm:"type:varchar(255);not null" json:"name"` // 节点名称
NodeType string `gorm:"type:varchar(20);not null" json:"node_type"` // 节点类型
NodeVersion string `gorm:"type:varchar(255)" json:"node_version"` // 节点版本
InstanceName string `gorm:"type:varchar(255)" json:"instance_name,omitempty"` // 数据源名称,在线审核时必填
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

数据源名称与dms耦合了,使用instance_id

})
}

func (svc PipelineSvc) DeletePipeline(projectUID string, pipelineID uint) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

projectUID 未用上

type PipelineNode struct {
gorm.Model
PipelineID uint `gorm:"type:bigint;not null;index" json:"pipeline_id"` // 关联的流水线ID
UUID string `gorm:"type:varchar(255);not null" json:"uuid"` // 节点uuid
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要有唯一约束

@winfredLIN winfredLIN self-assigned this Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants